<template>
  <div>
    <el-button type="primary" @click="clear">清空内容</el-button>
    <el-button type="primary"  @click="disabled = true" >禁用</el-button>
    <es-rich-text
      style="margin-top: 20px"
      v-model="msg"
      :disabled="disabled"
      @onClick="onClick"
      ref="editor"
    ></es-rich-text>
  </div>
</template>

<script>
  export default {
    name: "richTextDemo",
    data() {
      return {
        msg: 'Welcome to Use Tinymce Editor',
        disabled: false
      }
    },
    methods: {
      //鼠标单击的事件
      onClick(e, editor) {
        console.log('Element clicked')
        console.log(e)
        console.log(editor)
      },
      //清空内容
      clear() {
        this.$refs.editor.clear()
      }
    }
  }
</script>

<style scoped>

</style>
